﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Linq;
using System.Web;

namespace RepertorySystem.Models {
    public class OrderList {

        [Display(Name = "ID")]
        public int ID { get; set; }

        [Display(Name = "采购商")]
        [Required]
        [StringLength(50, MinimumLength = 2)]
        public string Procurer { get; set; }

        [Display(Name = "书名")]
        [Required]
        [Range(0, 100000)]
        public int Book_Id { get; set; }

        [Display(Name = "数量")]
        [Required]
        [Range(0, 100000)]
        public int Book_Number { get; set; }


        [Display(Name = "时间")]
        [Required]
        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        public DateTime Time { get; set; }


        [Display(Name = "价格")]
        [Required]
        [Range(0, 100000)]
        public int Price { get; set; }


        [Display(Name = "状态")]
        [Required]
        [Range(0, 1)]
        public int State { get; set; }
    }

    public class OrderListDbContext : DbContext {
        public DbSet<OrderList> OrderLists { get; set; }
    }
}